﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WebPiket3Csv
{
    /// <summary>
    /// Логика взаимодействия для MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            PrjProperty.Init();
            frameWizard.Navigate(new Uri(PrjProperty.pagesList[PrjProperty.curPageNo], UriKind.Absolute));
            this.Title = PrjProperty.stepList[PrjProperty.curPageNo];
            textBoxDesc.Text = PrjProperty.descList[PrjProperty.curPageNo];
        }
        private void ButtonCancelClick1(object sender, RoutedEventArgs e)
        {
            Close();
        }

        private void ButtonPrevClick1(object sender, RoutedEventArgs e)
        {
            PrjProperty.curPageNo--;
            if (PrjProperty.curPageNo > -1)
            {
                frameWizard.Navigate(new Uri(PrjProperty.pagesList[PrjProperty.curPageNo], UriKind.Absolute));
                this.Title = PrjProperty.stepList[PrjProperty.curPageNo];
                textBoxDesc.Text = PrjProperty.descList[PrjProperty.curPageNo];
            }
            else
                PrjProperty.curPageNo = 0;
        }

        private void ButtonNextClick1(object sender, RoutedEventArgs e)
        {
            PrjProperty.curPageNo++;
            if (PrjProperty.curPageNo < PrjProperty.pagesList.Count)
            {
                frameWizard.Navigate(new Uri(PrjProperty.pagesList[PrjProperty.curPageNo], UriKind.Absolute));
                this.Title = PrjProperty.stepList[PrjProperty.curPageNo];
                textBoxDesc.Text = PrjProperty.descList[PrjProperty.curPageNo];
                if (PrjProperty.curPageNo == PrjProperty.pagesList.Count - 1)
                    buttonFinish.IsEnabled = true;
            }
            else
                PrjProperty.curPageNo = PrjProperty.pagesList.Count - 1;

        }

        private void ButtonFinishClick(object sender, RoutedEventArgs e)
        {
            
            Close();
        }
    }
}
